import { network } from '@/utils';
import { SelectGardenParams, SelectOperationsParams } from './data';

import { basic } from '../../../../../config/Apis';

export async function queryCabinePlansDetail(params: any) {
  return network.get(basic.cab, { params });
}

export async function queryGardenList(params: SelectGardenParams) {
  return network.get(basic.garden_list, { params });
}


export async function queryOperationsList(params: SelectOperationsParams) {
  return network.get(basic.garden_list, { params });
}

export async function queryDepositCabList(params: { cabId: number }) {
  return network.get(basic.depositCab_list, { params });
}

export async function operAddOrUpdateSetting(params: any) {
  return network.put(basic.depositCab, { data: params });
}

export async function queryslaveTypeList() {
  return network.get(basic.cab_slaveType);
}


export async function checkPayMask(params: any) {
  return network.get(basic.cab_checkPayMask, { params });
}

export async function opertionAddOrUpdate(params: any) {
  return params.id
    ? network.put(basic.cab, { data: params })
    : network.post(basic.cab, { data: params });
}

export async function opertionDeleteSlave(params: { id: number, slaveCode: string}) {
  return network.deleter(basic.cab_deleteSlave, { params });
}
